﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Crucible.Models;
using Crucible.DocSearch;
using WebMatrix.WebData;
using System.Web.Http;

namespace Argument.Controllers
{
    public class QuickFindController : ApiController
    {

        //private ArgumentDbContext db = new ArgumentDbContext();


        //
        // GET: /api/QuickFind/Persuasive

        [HttpGet]
        public IEnumerable<SearchResult> Nodes(string searchText, int maxResults, IndexManager.SearchType typeMask)
        {

            return IndexManager.SearchAssertions(searchText, WebSecurity.CurrentUserName, typeMask, maxResults);

        }

        //[HttpPost]
        //public IEnumerable<SearchResult> Persuasive(string searchText, int maxResults)
        //{

        //    return IndexManager.SearchAssertions(searchText, WebSecurity.CurrentUserName, IndexManager.DocType.Persuasive, maxResults);

        //}

        //[HttpPost]
        //public IEnumerable<SearchResult> Source(string searchText, int maxResults)
        //{

        //    return IndexManager.SearchAssertions(searchText, WebSecurity.CurrentUserName, IndexManager.DocType.Source, maxResults);

        //}

        //[HttpPost]
        //public IEnumerable<SearchResult> Originator(string searchText, int maxResults)
        //{

        //    return IndexManager.SearchAssertions(searchText, WebSecurity.CurrentUserName, IndexManager.DocType.Originator, maxResults);

        //}

    }
}
